package org.code.mallspringboot.service.impl;

import org.code.mallspringboot.dto.FlashPromotionDto;
import org.code.mallspringboot.mapper.SmsFlashPromotionMapper;
import org.code.mallspringboot.pojo.SmsFlashPromotion;
import org.code.mallspringboot.service.SmsFlashPromotionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class SmsFlashPromotionServiceImpl implements SmsFlashPromotionService{

    @Autowired
    private SmsFlashPromotionMapper smsFlashPromotionMapper;

    @Override
    public List<SmsFlashPromotion> selectPage(String keyword, int pageNum, int pageSize) {
        return smsFlashPromotionMapper.selectPage(keyword, (pageNum - 1) * pageSize, pageSize);
    }

    @Override
    public int total(String keyword) {
        return smsFlashPromotionMapper.total(keyword);
    }

    @Override
    public int add(FlashPromotionDto flashPromotionDto) {
        return smsFlashPromotionMapper.add(flashPromotionDto);
    }

    @Override
    public int update_status(int id, int status) {
        return smsFlashPromotionMapper.update_status(id, status);
    }

    @Override
    public int update(FlashPromotionDto flashPromotionDto) {
        return smsFlashPromotionMapper.update(flashPromotionDto);
    }

    @Override
    public int delete(int id) {
        return smsFlashPromotionMapper.delete(id);
    }
}




